﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Navigation;
using Microsoft.SharePoint.Publishing;

namespace SPBusiness
{
    public sealed class SPEventFiring : SPItemEventReceiver, IDisposable
    {
        public SPEventFiring(bool pEnabled)
        {
            EventFiringEnabled = pEnabled;
        }
       
        public void Dispose()
        {
            Dispose(true);        
            GC.SuppressFinalize(this);
        }

        ~SPEventFiring() 
        {           
              Dispose(false);
        }

        public void Dispose(bool disposing)
        {
           if (disposing)
           {
             
              if (this != null)
              {
                 base.EventFiringEnabled = true;                                   
              }
              this.Dispose(false);
           }
          
        }


    }
}
